﻿namespace MobySharp.Actions
{
    public class CreateUser : BaseAction, IAction
    {
        private readonly YesNo _agreeTerms;
        private readonly string _email;
        private readonly string _firstname;
        private readonly YesNo _keepPosted;
        private readonly string _lastname;
        private readonly string _password;
        private readonly string _username;

        public CreateUser(string username, string password, string email, string firstname,
                          string lastname, YesNo keepPosted, YesNo agreeTerms)
        {
            _username = username;
            _password = password;
            _email = email;
            _firstname = firstname;
            _lastname = lastname;
            _keepPosted = keepPosted;
            _agreeTerms = agreeTerms;

            RequestType = HTTPRequestType.Get;
            Action = APICall.createUser;
        }

        [PostDataInstruction("username", true, 32)]
        public string Username
        {
            get { return _username; }
        }

        [PostDataInstruction("pin", true, 32)]
        public string Password
        {
            get { return _password; }
        }

        [PostDataInstruction("email", true)]
        public string Email
        {
            get { return _email; }
        }

        [PostDataInstruction("firstname", true)]
        public string Firstname
        {
            get { return _firstname; }
        }

        [PostDataInstruction("lastname", true)]
        public string Lastname
        {
            get { return _lastname; }
        }

        [PostDataInstruction("keepposted", true)]
        public YesNo KeepPosted
        {
            get { return _keepPosted; }
        }

        [PostDataInstruction("agreeterms", true)]
        public YesNo AgreeTerms
        {
            get { return _agreeTerms; }
        }
    }
}